/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PnlFondo.java
 *
 * Created on 18/05/2009, 11:18:21 PM
 */
package gui;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Toolkit;
import javax.swing.ImageIcon;

/**
 *
 * @author arquitectura
 */
public class xPnlFondo extends javax.swing.JPanel {

    public int numInter;

    /** Creates new form PnlFondo */
    public xPnlFondo(int numInterfaz) {

        numInter = numInterfaz;
        initComponents();
        this.setSize(800, 600);
    }

    @Override
    public void paintComponent(Graphics g) {

        Dimension tamanio = getSize();
        ImageIcon imagenFondo = new ImageIcon();

        if (numInter == 1) {//CrearPartida
            imagenFondo = new ImageIcon(getClass().getResource("/gui/CrearPartida.jpg"));
        }
        if (numInter == 2) {//Estadisticas
            imagenFondo = new ImageIcon(getClass().getResource("/gui/Estadisticas.jpg"));
        }
        if (numInter == 3) {//EstadoServidor
            imagenFondo = new ImageIcon(getClass().getResource("/gui/EstadoServidor.jpg"));
        }
        if (numInter == 4) {//HabilitarServidor
            imagenFondo = new ImageIcon(getClass().getResource("/gui/Home.jpg"));
        }
        if (numInter == 5) {//Home
            imagenFondo = new ImageIcon(getClass().getResource("/gui/Home.jpg"));
        }
        if (numInter == 6) {//HomeAdmin
            imagenFondo = new ImageIcon(getClass().getResource("/gui/HomeAdmin.jpg"));
        }
        if (numInter == 7) {//Ingresar
            imagenFondo = new ImageIcon(getClass().getResource("/gui/Ingresar.jpg"));
        }
        if (numInter == 8) {//Login
            imagenFondo = new ImageIcon(getClass().getResource("/gui/Login.jpg"));
        }
        if (numInter == 9) {//Tablero
            imagenFondo = new ImageIcon(getClass().getResource("/gui/Tablero.jpg"));
        }
        if (numInter == 10) {//VerPerfilAdmin
            imagenFondo = new ImageIcon(getClass().getResource("/gui/VerPerfilAdmin.jpg"));
        }
        if (numInter == 11) {//VerPerfilJugador
            imagenFondo = new ImageIcon(getClass().getResource("/gui/VerPerfilJugador.jpg"));
        }
        if (numInter == 12) {//MenuPartida
            imagenFondo = new ImageIcon(getClass().getResource("/gui/MenuPartida.jpg"));
        }
        if (numInter == 13) {//UnirseAPartida
            imagenFondo = new ImageIcon(getClass().getResource("/gui/UnirseAPartida.jpg"));
        }
        if (numInter == 14) {//ModificarPerfil
            imagenFondo = new ImageIcon(getClass().getResource("/gui/ModificarPerfil.jpg"));
        }
        if (numInter == 15) {//MenuPerfil
            imagenFondo = new ImageIcon(getClass().getResource("/gui/MenuPerfil.jpg"));
        }
        if (numInter == 16) {//MenuPerfil
            imagenFondo = new ImageIcon(getClass().getResource("/gui/InformeJuego.jpg"));
        }
        if (numInter == 17) {//MenuPerfil
            imagenFondo = new ImageIcon(getClass().getResource("/gui/TableroM2.jpg"));
        }


        g.drawImage(imagenFondo.getImage(), 0, 0, tamanio.width, tamanio.height, this);
        setOpaque(false);
        super.paintComponent(g);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
